<template>
	<h3>登分管理 - 课程选择</h3>
	<hr>
	<div>
		<table style="width: 100%;" border="1">
			<tbody>
				<tr>
					<th>班级编号</th>
					<th>班级名称</th>
					<th>课程号</th>
					<th>课程名称</th>
					<th>请选择</th>
				</tr>
				<tr v-for="x in data.marks">
					<td>{{x.clz.clzno}}</td>
					<td>{{x.clz.clzname}}</td>
					<td>{{x.course.cno}}</td>
					<td>{{x.course.cname}}</td>
					<td><button @click="go(x)">该班级学生进行登分或修改</button></td>
				</tr>
			</tbody>
		</table>
	</div>
</template>

<script setup>
	import {onMounted, reactive} from "vue"
	import {$get} from "@/ajax/";
	import router from "@/router"

	const data = reactive({
		marks:[]
	});
	
	const go=(obj)=>{
		router.push({
			path: "/tea/goMark",
			query: {
				clzno: obj.clz.clzno,
				cno: obj.course.cno,
			}
		})
	}
	
	onMounted(() => {
		$get("/api/fore/tea/findMyTask")
			.then((resp) =>{
				console.dir(resp.data.data)
				data.marks = resp.data.data
			})
	})
</script>

<style>
</style>